﻿namespace Hack.Decompiling.PEA.PE
{
  using System;
  using System.IO;

  /// <summary>
  /// Interface for OptionalHeader 32/64
  /// </summary>
  public interface OptionalHeader
  {
    PEType PEType { get; set; }
    SubSystem SubSystemAttribute { get; set; }
    DllAttributes DllAttributes { get; set; }
    UInt16 HeaderSize { get;}
    UInt32 AddressOfEntryPoint { get; set; }
    UInt32 BaseOfCode { get; set; }
    UInt32 BaseOfData { get; set; }
    UInt32 CheckSum { get; set; }
    UInt16 DllCharacteristics { get; set; }
    UInt32 FileAlignment { get; set; }
    UInt64 ImageBase { get; set; }
    UInt32 LoaderFlags { get; set; }
    UInt16 Magic { get; set; }
    UInt16 MajorImageVersion { get; set; }
    Byte   MajorLinkerVersion { get; set; }
    UInt16 MajorOperatingSystemVersion { get; set; }
    UInt16 MajorSubsystemVersion { get; set; }
    UInt16 MinorImageVersion { get; set; }
    Byte   MinorLinkerVersion { get; set; }
    UInt16 MinorOperatingSystemVersion { get; set; }
    UInt16 MinorSubsystemVersion { get; set; }
    UInt32 NumberOfRvaAndSizes { get; set; }
    UInt32 SectionAlignment { get; set; }
    UInt32 SizeOfCode { get; set; }
    UInt32 SizeOfHeaders { get; set; }
    UInt64 SizeOfHeapCommit { get; set; }
    UInt64 SizeOfHeapReserve { get; set; }
    UInt32 SizeOfImage { get; set; }
    UInt32 SizeOfInitializedData { get; set; }
    UInt64 SizeOfStackCommit { get; set; }
    UInt64 SizeOfStackReserve { get; set; }
    UInt32 SizeOfUninitializedData { get; set; }
    UInt16 SubSystem { get; set; }
    UInt32 Win32VersionValue { get; set; }
    UInt32 NumberOfDirectories { get; }
    unsafe ImageDataDirectory this[UInt32 index] { get; set; }
    unsafe ImageDataDirectory this[DirectoryEntries entry] { get; set; }
    unsafe OptionalHeader Read(System.IO.BinaryReader reader);
    unsafe OptionalHeader Write(System.IO.BinaryWriter writer);

    string ToString();
  }
}
